package com.itheima.job;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Day04Test2 {
    public static void main(String[] args) {
        String dateStr = "2020-12-12 12:23:12";
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime dateTime1 = LocalDateTime.parse(dateStr, formatter);
        System.out.println(dateTime1);
        LocalDateTime dateTime2 = dateTime1
                .plusYears(1)
                .plusMonths(2)
                .plusDays(3)
                .plusHours(4)
                .plusMinutes(8)
                .plusSeconds(45);
        DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH小时mm分钟ss秒");
        String dateStr2 = dateTime2.format(formatter1);
        System.out.println(dateStr2);
    }
}
